<?php

class models_common {

    private $_db;
    private $_cache;

    public function __construct($db, $cache) {
        $this->_db = $db;
        $this->_cache = $cache;
    }

    public function insert_order_log($order_nr) {
        
        $result = $this->_db->queryFirst("
                INSERT INTO order_tracking_log VALUES (:id, :order_nr, :date_created, :date_modified)
                ", array(':id' => null, ':order_nr' => $order_nr, ':date_created' => time(), ':date_modified' => time()), TRUE);
    }

    public function get_map_paymentmenthod($payment_method) {
        $resault = $this->_db->select('map_payment_method', array('payment_method' => $payment_method), null, null, null, TRUE);
        return $resault ? $resault[0]['text'] : NULL;
    }

}

?>